{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "54b7ba30",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from PIL import Image\n",
    "from mltools import data as ma\n",
    "from mltools import draw as md"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a9d8ee5c",
   "metadata": {},
   "outputs": [],
   "source": [
    "image = Image.open(\"../datasets/crack/images/train/train_0000.jpg\")\n",
    "md.numpy_to_image(np.array(image))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c8e5bac8",
   "metadata": {},
   "outputs": [],
   "source": [
    "bbox = ma.read_txt_label_file(\"../datasets/crack/labels/val/test_0001.txt\", bbox_type=\"center_w_h\")\n",
    "md.draw_bbox(\"../datasets/crack/images/val/test_0001.jpg\", bbox)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2b6a7080",
   "metadata": {},
   "outputs": [],
   "source": [
    "bbox = ma.read_txt_label_file(\"../datasets/RODD/labels/rs00001_jpg.rf.df4be284ed0d766434b5d47421357f78.txt\", bbox_type=\"center_w_h\")\n",
    "md.draw_bbox(\"../datasets/RODD/images/rs00001_jpg.rf.df4be284ed0d766434b5d47421357f78.jpg\", bbox)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "mltools",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
